package com.loongnoy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.loongnoy.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    // 根据用户名和密码查询用户
    @Select("SELECT * FROM user WHERE username = #{username} AND password = #{password}")
    User findByUsernameAndPassword(@Param("username") String username, @Param("password") String password);


    // 查询所有用户
    @Select("SELECT * FROM user")
    List<User> findAll();
}